package com.atom.module.author.mapper;

import com.atom.module.author.pojo.entity.Permission;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface PermissionMapper {

    //通过id , 软删除
    @Update("""
                UPDATE tb_permission
                SET deleted = 1 , version = version + 1
                WHERE id = #{id}
            """)
    Boolean deleteByPrimaryKey(Long id);

    //删除
    @Delete("DELETE FROM tb_permission where deleted = 1")
    Integer delete();

    int insert(Permission record);

    int insertSelective(Permission record);

    Permission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Permission record);

    int updateByPrimaryKey(Permission record);

}
